// custom-tab-bar/index.js
Component({
    /**
     * 组件的初始数据
     */
    data: {
      selected: 0,
      color: "#8a8a8a",
      selectedColor: "#e25b29",
      "list": [
        {
            "pagePath": "/pages/index/index",
            "text": "首页",
            "iconPath": "../image/upload/index.png",
            "selectedIconPath": "../image/upload/indexActive.png"
        },
        {
            "pagePath": "/pages/classify/classify",
            "text": "分类",
            "iconPath": "../image/upload/classify.png",
            "selectedIconPath": "../image/upload/classifyActive.png"
        },
        {
            "pagePath": "/pages/live/live",
            "text": "品质生活圈",
            "iconPath": "../image/upload/live.png",
            "selectedIconPath": "../image/upload/liveActive.png"
        },
        {
            "pagePath": "/pages/shopCar/shopCar",
            "text": "购物车",
            "iconPath": "../image/upload/shop.png",
            "selectedIconPath": "../image/upload/shopActive.png"
        },
        {
            "pagePath": "/pages/mine/mine",
            "text": "我的",
            "iconPath": "../image/upload/my.png",
            "selectedIconPath": "../image/upload/myActive.png"
        }
      ]
    },
  
    attached() {
    },
    methods: {
      switchTab(e) {
        let that = this
        const data = e.currentTarget.dataset
        const url = data.path
        wx.switchTab({url})
        that.setData({
          selected: data.index
        })
      }
    }
  })
